<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <title>笔记 - FNK</title>
        <link rel="stylesheet" href="/static/css/navbar.css">
        <link rel="stylesheet" href="/static/css/page.css">
    </head>
    <body>
        <nav class="navbar">
            <div class="logo">FNK</div>
            <ul class="nav-links">
                <li><a href="/home">首页</a></li>
                <li><a href="/file">文件</a></li>
                <li><a href="/note">笔记</a></li>
                <li><a href="/resource">资源</a></li>
                <li><a href="/about">关于</a></li>
            </ul>
            <div class="users">
                {% if user %}
                    <p>{{ user }}</p>
                    <button class="user-btn" onclick="javascript:location.href='/logout'">登出</button>
                {% else %}
                    <button class="user-btn" onclick="javascript:location.href='/login'">登录</button>
                {% endif %}
            </div>
        </nav>
        <div class="page-box">
            <div class="page-header">
                <h1 class="title">笔记</h1>
                <button onclick="javascript:location.href='/note/add/{{ user }}'" class="btn">写笔记</button>
            </div>
            <table class="table-passage">
                <thead style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif;">
                    <tr style="line-height: 50px;">
                        <th width="50%">标题</th>
                        <th width="15%">作者</th>
                        <th width="35%">创建时间</th>
                    </tr>
                </thead>
                <tbody>
                    {% for note in notes %}
                        <tr>
                            <td><a href="/note/share/{{ user }}/{{ note['title'] }}">   {{ note['title'] }}</a></td>
                            <td><a href="#">{{ note['Author'] }}</td>
                            <td style="color: grey;">{{ note['CreateTime'] }}</td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
            <!-- {% for note in notes %}
                <div>
                    <a href="/note/share/{{ user }}/{{ note }}">{{ note }}</a>
                </div>
            {% endfor %} -->
        </div>

    </body>
</html>